class OrderListEntity {
  List<OrderListDataData> data;
  int code;
  String msg;

  OrderListEntity({this.data, this.code, this.msg});

  OrderListEntity.fromJson(Map<String, dynamic> json) {
    // data =
    // json['data']['list'] != null ? new OrderListData.fromJson(json['data']['list']) : null;
    if (json['data']['list'] != null) {
      data = new List<OrderListDataData>();
      (json['data']['list'] as List).forEach((v) {
        data.add(new OrderListDataData.fromJson(v));
      });
    }
    code = json['code'];
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    // if (this.data != null) {
    //   data['data']['list']['data'] = this.data.toJson();
    // }
    if (this.data != null) {
      data['data']['list'] = this.data.map((v) => v.toJson()).toList();
    }
    data['code'] = this.code;
    data['msg'] = this.msg;
    return data;
  }
}

// class OrderListData {
//   List<OrderListDataData> datas;

//   OrderListData();

//   OrderListData.fromJson(Map<String, dynamic> json) {
//     if (json['data'] != null) {
//       datas = new List<OrderListDataData>();
//       (json['data'] as List).forEach((v) {
//         datas.add(new OrderListDataData.fromJson(v));
//       });
//     }
//   }

//   Map<String, dynamic> toJson() {
//     final Map<String, dynamic> data = new Map<String, dynamic>();
//     if (this.datas != null) {
//       data['data'] = this.datas.map((v) => v.toJson()).toList();
//     }
//     return data;
//   }
// }

class OrderListDataData {
  String contact_number;
  String status;
  String id;
  String address;
  String start_time;
  String consignee;
  String create_time;
  String allprice;
  String order_num;
  String logistics;
  String express_number;
  bool isSelect = false;
  String trade_id;
  String num_iid;
  String item_title;
  String item_num;
  String seller_shop_title;
  String commission;
  String commission_rate;
  String earning_time;
  String tk_status;
  String order_type;
  String alipay_total_price;
  String total_commission_rate;
  String total_commission_fee;
  String goods_img;
  String order_sn;
  String goods_id;
  String goods_name;
  String goods_thumbnail_url;
  String goods_quantity;
  String goods_price;
  String order_amount;
  String promotion_rate;
  String promotion_amount;
  String batch_no;
  String order_status;
  String order_status_desc;
  String order_create_time;
  String order_pay_time;
  String order_group_success_time;
  String order_receive_time;
  String order_verify_time;
  String order_settle_time;
  String order_modify_at;
  String match_channel;
  String type;
  String group_id;
  List<OrderListDetailData> datas;

  OrderListDataData(
      {this.contact_number,
      this.allprice,
      this.order_num,
      this.status,
      this.id,
      this.start_time,
      this.create_time,
      this.consignee,
      this.logistics,
      this.express_number,
      this.address});

  OrderListDataData.fromJson(Map<String, dynamic> json) {
    express_number = json['express_number'];
    logistics = json['logistics'];
    address = json['address'];
    create_time = json['create_time'];
    order_num = json['order_num'];
    consignee = json['consignee'];
    id = json['id'].toString();
    order_status_desc = json['order_status_desc'].toString();
    order_pay_time = json['order_pay_time'].toString();
    order_settle_time = json['order_settle_time'].toString();

    group_id = json['group_id'].toString();
    type = json['type'].toString();
    match_channel = json['match_channel'].toString();
    order_modify_at = json['order_modify_at'].toString();
    order_sn = json['order_sn'].toString();
    goods_id = json['goods_id'].toString();
    goods_name = json['goods_name'].toString();
    goods_thumbnail_url = json['goods_thumbnail_url'].toString();
    goods_quantity = json['goods_quantity'].toString();
    goods_price = json['goods_price'].toString();
    order_amount = json['order_amount'].toString();
    promotion_rate = json['promotion_rate'].toString();
    promotion_amount = json['promotion_amount'].toString();
    order_status = json['order_status'].toString();
    num_iid = json['num_iid'].toString();
    item_title = json['item_title'].toString();
    item_num = json['item_num'].toString();
    commission = json['commission'].toString();
    seller_shop_title = json['seller_shop_title'].toString();
    commission_rate = json['commission_rate'].toString();
    earning_time = json['earning_time'].toString();
    tk_status = json['tk_status'].toString();
    goods_img = json['item_img'].toString();
    total_commission_fee = json['total_commission_fee'].toString();
    total_commission_rate = json['total_commission_rate'].toString();
    alipay_total_price = json['alipay_total_price'].toString();
    order_type = json['order_type'].toString();
    trade_id = json['trade_id'].toString();
    allprice = json['allprice'].toString();
    status = json['status'].toString();
    contact_number = json['contact_number'];
    start_time = json['start_time'];
    if (json['detail'] != null) {
      datas = new List<OrderListDetailData>();
      (json['detail'] as List).forEach((v) {
        datas.add(new OrderListDetailData.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['contact_number'] = this.contact_number;
    data['start_time'] = this.start_time;
    data['consignee'] = this.consignee;
    data['id'] = this.id;
    data['allprice'] = this.allprice;
    data['create_time'] = this.create_time;
    data['address'] = this.address;
    data['status'] = this.status;
    return data;
  }
}

class OrderListDetailData {
  String order_detail_id;
  String goods_id;
  String img;
  String goods_name;
  String start_time;
  String num;
  String sku_str;
  String price;
  String order_num;
  OrderListDetailData(
      {this.order_detail_id,
      this.price,
      this.order_num,
      this.goods_id,
      this.img,
      this.start_time,
      this.sku_str,
      this.num,
      this.goods_name});

  OrderListDetailData.fromJson(Map<String, dynamic> json) {
    goods_name = json['goods_name'];
    sku_str = json['sku_str'];
    order_num = json['order_num'];
    num = json['num'].toString();
    img = json['img'].toString();
    price = json['price'].toString();
    goods_id = json['goods_id'].toString();
    order_detail_id = json['order_detail_id'].toString();
    order_num = json['order_num'].toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['order_detail_id'] = this.order_detail_id;
    data['order_num'] = this.order_num;
    data['num'] = this.num;
    data['img'] = this.img;
    data['price'] = this.price;
    data['sku_str'] = this.sku_str;
    data['goods_name'] = this.goods_name;
    data['goods_id'] = this.goods_id;
    return data;
  }
}

class OrderListDataDatasTag {
  String name;
  String url;

  OrderListDataDatasTag({this.name, this.url});

  OrderListDataDatasTag.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    url = json['url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['url'] = this.url;
    return data;
  }
}
